import { mockPrefix } from '@/config/settings'
import Mock from 'mockjs'

const user = {
  id: '5ffa80aD-9CF4-0C77-eBFC-f6612BfAcF4F',
  account: 'admin',
  password: '123456',
  address: '36918166@qq.com',
  name: '杨永信',
  dept: '思明分中心'
}

const leftMenu = [
  {
    path: '/house',
    hidden: false,
    redirect: 'noRedirect',
    component: 'Layout',
    meta: { title: '国有建设用地使用权及房屋所有权', icon: 'system', noCache: false, link: null },
    children: [
      {
        name: '11010101',
        path: '11010101',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '首次登记', icon: '', noCache: false, link: null, typebCode: '11010101' }
      },
      {
        name: '11010102',
        path: '11010102',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '变更登记', icon: '', noCache: false, link: null, typebCode: '11010102' }
      },
      {
        name: '11010103',
        path: '11010103',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '转移登记', icon: '', noCache: false, link: null, typebCode: '11010103' }
      },
      {
        name: '11010104',
        path: '11010104',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '注销登记', icon: '', noCache: false, link: null, typebCode: '11010104' }
      }
    ]
  },
  {
    path: '/area',
    hidden: false,
    redirect: 'noRedirect',
    component: 'Layout',
    meta: { title: '国有建设用地使用权及房屋所有权', icon: 'system', noCache: false, link: null },
    children: [
      {
        name: '12010101',
        path: '12010101',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '首次登记', icon: '', noCache: false, link: null, typebCode: '11010101' }
      },
      {
        name: '12010102',
        path: '12010102',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '变更登记', icon: '', noCache: false, link: null, typebCode: '11010102' }
      },
      {
        name: '12010103',
        path: '12010103',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '转移登记', icon: '', noCache: false, link: null, typebCode: '11010103' }
      },
      {
        name: '12010104',
        path: '12010104',
        hidden: false,
        component: 'tabs/BaseMenuTab',
        meta: { title: '注销登记', icon: '', noCache: false, link: null, typebCode: '11010104' }
      }
    ]
  },
  {
    name: 'Store',
    path: '/store',
    hidden: false,
    redirect: 'noRedirect',
    component: 'Layout',
    meta: { title: '状态管理', icon: 'system', noCache: false, link: null },
    children: [
      {
        name: 'Pinia',
        path: 'pinia',
        hidden: false,
        component: 'store/index',
        meta: { title: 'pinia状态管理', icon: '', noCache: false, link: null }
      },
      {
        name: 'Vuex',
        path: 'vuex',
        hidden: false,
        component: 'VuexView',
        meta: { title: 'Vuex状态管理', icon: '', noCache: false, link: null }
      }
    ]
  },
  {
    name: 'Http://ruoyi.vip',
    path: 'http://ruoyi.vip',
    hidden: false,
    component: 'Layout',
    meta: {
      title: '若依官网',
      icon: 'guide',
      noCache: false,
      link: 'http://ruoyi.vip'
    }
  }
]
const topMenu = [
  {
    name: 'multiquery',
    path: '/multiquery',
    hidden: false,
    redirect: 'noRedirect',
    component: 'Layout',
    alwaysShow: true,
    meta: { title: '综合查询', icon: '', noCache: false, link: null },
    children: [
      {
        name: 'lccx',
        path: 'multi/510100',
        hidden: false,
        component: 'tabs/BaseTab',
        meta: { title: '流程查询', icon: '', noCache: false, link: null, typebCode: '510100' }
      },
      {
        name: 'wdwcx',
        path: 'multi/511600',
        hidden: false,
        component: 'tabs/BaseTab',
        meta: { title: '外单位查询', icon: '', noCache: false, link: null, typebCode: '511600' },
        children: [
          {
            name: 'gxcx',
            path: 'multi/511002',
            hidden: false,
            component: 'tabs/BaseTab',
            meta: { title: '共享查询', icon: '', noCache: false, link: null, typebCode: '511002' }
          },
          {
            name: 'frxxcx',
            path: 'multi/511100',
            hidden: false,
            component: 'tabs/BaseTab',
            meta: { title: '法人信息查询', icon: '', noCache: false, link: null, typebCode: '511100' }
          },
          {
            name: 'dacx',
            path: 'multi/511500',
            hidden: false,
            component: 'tabs/BaseTab',
            meta: { title: '档案擦好像查询', icon: '', noCache: false, link: null, typebCode: '511500' }
          }
        ]
      },
      {
        name: 'register',
        path: 'multi/510400',
        hidden: false,
        component: 'tabs/BaseTab',
        meta: { title: '登记业务查询', icon: '', noCache: false, link: null, typebCode: '510500' },
        children: [
          {
            name: 'gxcx',
            path: 'multi/511002',
            hidden: false,
            component: 'tabs/BaseTab',
            meta: { title: '共享查询', icon: '', noCache: false, link: null, typebCode: '511002' }
          },
          {
            name: 'frxxcx',
            path: 'multi/511100',
            hidden: false,
            component: 'tabs/BaseTab',
            meta: { title: '法人信息查询', icon: '', noCache: false, link: null, typebCode: '511100' }
          },
          {
            name: 'dacx',
            path: 'multi/511500',
            hidden: false,
            component: 'tabs/BaseTab',
            meta: { title: '档案擦好像查询', icon: '', noCache: false, link: null, typebCode: '511500' }
          }
        ]
      }
    ]
  },
  {
    name: 'transmanager',
    path: '/transmanager',
    hidden: false,
    redirect: 'noRedirect',
    component: 'Layout',
    meta: { title: '案件管理', icon: '', noCache: false, link: null }
  },
  {
    name: 'alertmanager',
    path: '/alertmanager',
    hidden: false,
    redirect: 'noRedirect',
    component: 'Layout',
    meta: { title: '公告管理', icon: '', noCache: false, link: null }
  },
  {
    name: 'helputil',
    path: '/helputil',
    hidden: false,
    redirect: 'noRedirect',
    component: 'Layout',
    meta: { title: '辅助功能', icon: '', noCache: false, link: null }
  }
]

Mock.mock(mockPrefix + '/login', 'post', () => {
  return {
    code: 200,
    data: { token: '666' },
    msg: '登录成功'
  }
})

Mock.mock(mockPrefix + '/logout', 'post', () => {
  return {
    code: 200,
    msg: '退出成功'
  }
})

Mock.mock(mockPrefix + '/init', 'get', () => {
  return {
    code: 200,
    data: {
      user,
      leftMenu,
      topMenu
    },
    msg: '初始化数据成功'
  }
})
